Skip to content

获取发票下载信息

商户在开具发票成功后,调用本接口获取电子发票的下载地址。仅在微信支付侧开具的电子发票才允许下载发票文件。 注意:开票状态为ISSUED的发票才能获取到发票文件下载链接。

请求参数类型描述
fapiao_apply_idstring发票申请单号
queryobject声明请求的查询参数
sub_mchidstring子商户号
fapiao_idstring商户发票单号
php
$instance->v3->newTaxControlFapiao->fapiaoApplications->_fapiao_apply_id_->fapiaoFiles->getAsync([
  'fapiao_apply_id' => '4200000444201910177461284488',
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_id' => '20200701123456',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}/fapiao-files')->getAsync([
  'fapiao_apply_id' => '4200000444201910177461284488',
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_id' => '20200701123456',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}/fapiao-files']->getAsync([
  'fapiao_apply_id' => '4200000444201910177461284488',
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_id' => '20200701123456',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->newTaxControlFapiao->fapiaoApplications->_fapiao_apply_id_->fapiaoFiles->get([
  'fapiao_apply_id' => '4200000444201910177461284488',
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_id' => '20200701123456',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}/fapiao-files')->get([
  'fapiao_apply_id' => '4200000444201910177461284488',
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_id' => '20200701123456',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}/fapiao-files']->get([
  'fapiao_apply_id' => '4200000444201910177461284488',
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_id' => '20200701123456',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
fapiao_download_info_listobject[]发票列表
fapiao_idstring商户发票单号
download_urlstring发票文件下载地址
statusstring发票状态

参阅 官方文档

Published on the GitHub by TheNorthMemory